#ifndef COMMON_DEFS_H_
#define COMMON_DEFS_H_


// debug prints - DBG_PRINT for flow prints, ERR_PRINT should be used when an error occurred
#ifdef NDEBUG
	#define DBG_PRINT(format, args ...)  	((void) 0 ) // do nothing
	#define ERR_PRINT(format, args ...)  	((void) 0 ) // do nothing
	#define PRINT_ERROR(args...)			std::cout << "Error: " << args << endl;
	#define PRINT_MSG(args...)				std::cout << args << endl;
#else
	#define PRINT_ERROR(args...)			std::cout << "Error: " << args << endl;
	#define PRINT_MSG(args...)				std::cout << args << endl;
	#ifdef __cplusplus
		#include <iostream>
		#define DBG_PRINT(args ...) std::cout << __func__ << "," << __LINE__ << ": " << args << std::endl;
		#define ERR_PRINT(args ...) std::cerr << __func__ << "," << __LINE__ << ": " << args << std::endl;
	#else
		#include <cstdio>
		#define DBG_PRINT(args ...) printf("%s, %d: ",__func__, __LINE__);  		printf(args)
		#define ERR_PRINT(args ...) fprintf(stderr,"%s, %d: ",__func__, __LINE__); 	fprintf(stderr,args)
	#endif
#endif

typedef enum
{
	OPERATION_SUCCESS 				= 0	,
	ERROR_IO							,
	ERROR_SYSTEM_CALL					,
	ERROR_INVALID_ARGS					,
	ERROR_ZERO_SIZE_MESSAGE				,
	ERROR_BAD_MESSAGE					,
	ERROR_NETWORK_CONN

} result_t;


#endif /* COMMON_DEFS_H_ */
